import { error } from "./log"

const isEmpty = (value: any) => {
  if (value === null || value === undefined || value.length === 0) return true
  else return false
}
const isNotEmpty = (value: any) => {
  return !isEmpty(value)
}
const getChar=(value:string,index:number)=>{
    if(isEmpty(value))
      {
        error("传入字符串为空")
        return
      }
    return value.substring(index,index+1)
}
const getStr=(value:string,start:number,length:number)=>{
    if(isEmpty(value))
      {
        error("传入字符串为空")
        return
      }
    return value.substring(start,start+length)
}
const StrUtil= {isEmpty,getChar,getStr}
export default StrUtil;
